﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;

public partial class Style : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        XmlDocument xmlDoc = new XmlDocument();
        String path = "/CMSProject/Data/design.xml";
        xmlDoc.Load(Server.MapPath(path));

        XmlNodeList nodeListFont = xmlDoc.SelectNodes("/Design/Font");
        XmlNodeList nodeListBack = xmlDoc.SelectNodes("/Design/Background");

        //Response.ContentType = "text/css";

        for (int i = 0; i < 5; i++)
        {
            String response = String.Format("{0}{size: {1};font-face: {2};color: {3};background-color: {4};}",nodeListFont[0].ChildNodes[i].Name,nodeListFont[0].ChildNodes[i].ChildNodes[1],nodeListFont[0].ChildNodes[i].ChildNodes[1], nodeListFont[0].ChildNodes[i].ChildNodes[2], nodeListFont[0].ChildNodes[i].ChildNodes[3]);
            Response.Write(response);
            Response.Write(Environment.NewLine);
        }

        /*Response.Write();
        Response.Write(Environment.NewLine);
        Response.Write("DesignHeading{size: {0};font-face: {1};color: {2};background-color: {3};}");
        Response.Write(Environment.NewLine);
        Response.Write("DesignHeading{size: {0};font-face: {1};color: {2};background-color: {3};}");
        Response.Write(Environment.NewLine);
        Response.Write("DesignHeading{size: {0};font-face: {1};color: {2};background-color: {3};}");
        Response.Write(Environment.NewLine);
        Response.Write("DesignHeading{size: {0};font-face: {1};color: {2};background-color: {3};}");
        Response.Write(Environment.NewLine);*/

        for (int i = 0; i < 5; i++)
        {
            String response = String.Format("{0}{background-color: {1};}", nodeListFont[0].ChildNodes[i].Name, nodeListFont[0].ChildNodes[i].ChildNodes[0].InnerText.ToString());
            Response.Write(response);
            Response.Write(Environment.NewLine);
        }
    }
}